package com.forest.constants;

/**
 * 加密算法.
 *
 * @author Administrator
 */
public enum EncryptionAlgorithm {
    SM4("SM4"),
    AES("AES"),
    ;

    EncryptionAlgorithm(String algorithm) {
        this.algorithm = algorithm;
    }
    private String algorithm;

    public String getAlgorithm() {
        return algorithm;
    }

    public static EncryptionAlgorithm getByAlgorithm(String algorithm) {
        for (EncryptionAlgorithm value : values()) {
            if (value.getAlgorithm().equals(algorithm)) {
                return value;
            }
        }
        return null;
    }
}
